﻿using System;
using System.Net;

using Newtonsoft.Json;

namespace Tulde.Windows.Music.ViewModel
{
    [Serializable()]
    [JsonObject()]
    public class Mp3TunesCredentials : ICredentials
    {
        [JsonProperty()]
        public string Token { get; set; }
        [JsonProperty()]
        public string UserName { get; set; }
        [JsonProperty()]
        public string Password { get; set; }
        public Mp3TunesCredentials()
        {

        }

        #region ICredentials Members

        public NetworkCredential GetCredential(Uri uri, string authType)
        {
            return new NetworkCredential
            {
                Domain = this.Token,
                UserName = this.UserName,
                Password = this.Password
            };
        }

        #endregion
    }
}
